#ifndef _CAM_CORE_H_
#define _CAM_CORE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "lv_drv_conf.h"

#if USE_CRANE_CAMERA

#include "cam_offline.h"
#include "../../board.h"

typedef struct _CCCaputreStruct {
    uint16_t image_width;
    uint16_t image_height;
    unsigned char media_mode;
}CCCaputreStruct;

//error define
typedef int CCError;

#define CRANE_CAMERA_ERROR_NONE             0
#define CRANE_CAMERA_ERROR_BADPOINTER       1001
#define CRANE_CAMERA_ERROR_BADARGUMENT      1002
#define CRANE_CAMERA_ERROR_INVALIDOPERATION 1003
#define CRANE_CAMERA_ERROR_OUTOFMEMORY      1004
#define CRANE_CAMERA_ERROR_NOTFOUND         1006
#define CRANE_CAMERA_ERROR_NOTSUPPORT       1007
#define CRANE_CAMERA_ERROR_TIMEOUT          1008
#define CRANE_CAMERA_ERROR_DEVICEWASOPENED  1009
#define CRANE_CAMERA_ERROR_FATALERROR       1010

//camera status
#define CAMERA_STATUS_IDLE     0x0
#define CAMERA_STATUS_PREVIEW  0x1
#define CAMERA_STATUS_VIDEO    0x2
#define CAMERA_STATUS_CAPTURE  0x4

typedef struct _CCamRecordParmeters {
    unsigned recordWidth;
    unsigned recordHeight;
    unsigned recordFormat;
    unsigned recordFramerate;
    void (*setReleaseBufferCallBack)(ReleaseBufferCallback callBackHandle, void *userData);
    void (*enqueueCamRecordBuffer)(void *pBuf, int bufIndex);
    void (*flushCamRecordBuffers)(void);
} CamRecordParmeters;

typedef struct {
    uint16_t width;       //in out
    uint16_t height;      //in out
    uint32_t jpeg_size;   //out
}CCaptureParamStruct;

#endif /* USE_CRANE_CAMERA */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
